package pl.elka.simulator.core;

public class Segment {
	public Position begin;
	public Position end;
	public Segment(Position begin, Position end) {
		super();
		this.begin = begin;
		this.end = end;
	}
	public Segment() {
		super();
	}
	@Override
	public String toString() {
		return "Segment [begin=" + begin + ", end=" + end + "]";
	}
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((begin == null) ? 0 : begin.hashCode());
		result = prime * result + ((end == null) ? 0 : end.hashCode());
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Segment other = (Segment) obj;
		if (begin == null) {
			if (other.begin != null)
				return false;
		} else if (!begin.equals(other.begin))
			return false;
		if (end == null) {
			if (other.end != null)
				return false;
		} else if (!end.equals(other.end))
			return false;
		return true;
	}		
}
